package home.contaduria.service.impl;

import home.contaduria.dao.IncomeTypeDao;
import home.contaduria.domain.Client;
import home.contaduria.domain.IncomeType;
import home.contaduria.service.IncomeTypeService;

import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("incomeTypeService")
public class IncomeTypeServiceImpl implements IncomeTypeService {
    private static final Logger logger = LoggerFactory.getLogger(IncomeTypeServiceImpl.class);

    private IncomeTypeDao incomeTypeDao;

    @Autowired
    public IncomeTypeServiceImpl(IncomeTypeDao incomeTypeDao) {
        this.incomeTypeDao = incomeTypeDao;
    }

    @Override
    @Transactional(readOnly = true, rollbackFor = Exception.class)
    public Collection<IncomeType> loadClientIncomeTypes(Client client) {
        return incomeTypeDao.loadClientIncomeTypes(client);
    }

}
